import request from '@/utils/request'


// 查询列表
export function listRainfall(query) {
  return request({
    url: '/sjgtw-emergency/rainfall/list',
    method: 'get',
    params: query
  })
}

// 查询详细
export function getRainfall(id) {
  return request({
    url: '/sjgtw-emergency/rainfall/' + id,
    method: 'get'
  })
}

// 新增
export function addRainfall(data) {
  return request({
    url: '/sjgtw-emergency/rainfall',
    method: 'post',
    data: data
  })
}

// 修改
export function updateRainfall(data) {
  return request({
    url: '/sjgtw-emergency/rainfall',
    method: 'put',
    data: data
  })
}

// 删除
export function delRainfall(id) {
  return request({
    url: '/sjgtw-emergency/rainfall/' + id,
    method: 'delete'
  })
}


// 下发
export function issueRainfall(data) {
    return request({
      url: '/sjgtw-emergency/rainfall/issue',
      method: 'post',
      data: data
    })
  }

// 查询降雨预警列表(历史)
export function rainfallListHistory(data) {
    return request({
      url: '/sjgtw-emergency/rainfall/listHistory',
      method: 'get',
      params: query
    })
  }
// 查看
export function viewRainfall(query) {
    return request({
      url: '/sjgtw-emergency/rainfall/getInfo',
      method: 'get',
      params: query
    })
  }